#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
bool isPalindrome(int x)
{
    // write code here
    bool ture = 1;
    if (x < 0)
        return 0;

    int sum = 0;
    int len = 0;
    int ret = x;
    while (x /= 10)
    {
        len++;
    }
    x = ret;
    do
    {
        sum += (x % 10) * pow(10, len);
        len--;
    } while (x /= 10);
    if (sum == ret)
        return ture;
    else
        return 0;
}
int main()
{
    int a = 0;
    scanf("%d", &a);
    printf("%d\n",isPalindrome(a));
	return 0;
}